import request from '@/utils/request'

// 查询企业信息列表
export function listInfo(query) {
  return request({
    url: '/enterprise/info/list',
    method: 'get',
    params: query
  })
}
//查询平台的所有企业信息列表
export function platformList(query) {
  return request({
    url: '/enterprise/info/platformList',
    method: 'get',
    params: query
  })
}


// 查询根据组织机构id查询不属于自己的企业数据信息列表
export function listToAdmin(query) {
  return request({
    url: '/enterprise/info/listToAdmin',
    method: 'get',
    params: query
  })
}

// 查询自己私有企业数据信息列表
export function listInfoPrivate(query) {
  return request({
    url: '/enterprise/info/listPrivate',
    method: 'get',
    params: query
  })
}
export function enterpriseVerify(data) {
  return request({
    url: '/enterprise/info/enterpriseVerify',
    method: 'post',
    data: data
  })
}
// 查询企业最新进展信息列表
export function listEnterpriseFollow(query) {
  return request({
    url: '/enterprise/info/getNewFollowList',
    method: 'get',
    params: query
  })
}
// 查询商机最新进展信息列表
export function listBusinessFollow(query) {
  return request({
    url: '/enterprise/info/getNewBusinessFollowList',
    method: 'get',
    params: query
  })
}
// 查询公海最新进展信息列表
export function listHighSeasFollow() {
  return request({
    url: '/highSeas/seas/listByIndex',
    method: 'get'
  })
}
// 查询电销最新进展信息列表
export function listElectricFollow() {
  return request({
    url: '/electric/electric/listByIndex',
    method: 'get'
  })
}

export function getMaxEnterpriseNo() {
  return request({
      url: "/enterprise/info/getMaxEnterpriseNo",
      method: "get",

  });
}
//查询是否存在公海
export function getHighSeaslistToName(query) {
  return request({
    url: '/enterprise/info/highSeasListToName',
    method: 'get',
    params: query
  })
}
//查询是否存在电销
export function getSalelistToName(query) {
  return request({
    url: '/enterprise/info/saleListToName',
    method: 'get',
    params: query
  })
}
export function listToName(query) {
  return request({
    url: '/enterprise/info/listToName',
    method: 'get',
    params: query
  })
}

// 查询企业信息详细
export function getInfo(enterpriseId) {
  return request({
    url: '/enterprise/info/' + enterpriseId,
    method: 'get'
  })
}

// 新增企业信息
export function addInfo(data) {
  return request({
    url: '/enterprise/info',
    method: 'post',
    data: data
  })
}

// 修改企业信息
export function updateInfo(data) {
  return request({
    url: '/enterprise/info',
    method: 'put',
    data: data
  })
}

// 删除企业信息
export function delInfo(enterpriseId) {
  return request({
    url: '/enterprise/info/' + enterpriseId,
    method: 'delete'
  })
}
export function delHighSeasByEnterpriseId(enterpriseId) {
  return request({
      url: '/enterprise/info/highSeas/'+ enterpriseId,
      method: "delete",
  });
}


export function editMainClass(data) {
  return request({
      url: "/enterprise/info/editMainClass",
      method: "post",
      data
  });
}

export function editBusinessManager(data) {
  return request({
      url: "/enterprise/info/editBusinessManager",
      method: "post",
      data
  });
}
//查询所有的供应商类型的客户数据
export function supplierList(query) {
  return request({
    url: '/enterprise/info/supplierList',
    method: 'get',
    params: query
  })
}

//查询机构所有的业务经理
export function getBusinessManagerList() {
  return request({
    url: '/enterprise/info/getBusinessManagerList',
    method: 'get'
  })
}
